package com.mbengue.corp.artisan.modele;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedNativeQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "feuille_article")
@NamedNativeQuery(name = "tousLesArticlesD1Feuille", query = "select * from article a where a.code in (select fa.code from feuille_article fa where fa.numero=?)", resultClass = Article.class)
public class ArticlesFeuille implements Serializable {
  private static final long serialVersionUID = 5899168101253014939L;

  @Id
  @GeneratedValue
  private long id;
  @OneToOne
  @JoinColumn(name = "code")
  private Article article;
  @OneToOne
  @JoinColumn(name = "numero")
  private Feuille feuille;

  public ArticlesFeuille() {
  }

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  public Article getArticle() {
    return article;
  }

  public void setArticle(Article article) {
    this.article = article;
  }

  public Feuille getFeuille() {
    return feuille;
  }

  public void setFeuille(Feuille feuille) {
    this.feuille = feuille;
  }
}
